package com.zhang.spring.config;

import com.zhang.spring.bean.Cat;
import com.zhang.spring.bean.Person;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.GenericBeanDefinition;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.cache.Cache;
import org.springframework.context.annotation.*;
import org.springframework.core.type.AnnotationMetadata;

@Configuration
@ComponentScan("com.zhang")
public class MainConfig {


	static class MyImportRegistrar implements ImportBeanDefinitionRegistrar{
		public  void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
			GenericBeanDefinition catDefiniton= new GenericBeanDefinition();
			catDefiniton.setBeanClass(Cat.class);
		   registry.registerBeanDefinition("mycat",catDefiniton);
		}
	}
}
